package yangcheng.student;

public interface Student {
    void  setName(String name);
    void setid(String id);
    void printInfo();
    boolean isExcellent();
}

class StudentG implements Student {
    public String name;
    public String id;
    public boolean isCET4passed;
    public double lastYearScore;

    public StudentG() {
    }
    public StudentG(String name, String id, boolean isCET4passed, double lastYearScore) {
        this.name = name;
        this.id = id;
        this.isCET4passed = isCET4passed;
        this.lastYearScore = lastYearScore;
    }

    public void setCET4passed(boolean passed) {
        this.isCET4passed = passed;
    }
    public void setScore(double Score) {
        this.lastYearScore = Score;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }
    public void setid(String id) {
        this.id = id;
    }
    public void printInfo() {
        System.out.printf("\nName: %s\nid: %s\nisCET4passed: %b\nlastYearScore: %.2f\n", name,id,isCET4passed,lastYearScore);
    }
    public boolean isExcellent() {
        return isCET4passed && lastYearScore >= 80;
    }
}

class StudentM implements Student {
    public String name;
    public String id;
    public boolean isCET6passed;
    public int paperCount;

    public StudentM() {
    }

    public StudentM(String name, String id, boolean isCET6passed, int paperCount) {
        this.name = name;
        this.id = id;
        this.isCET6passed = isCET6passed;
        this.paperCount = paperCount;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }
    public void setid(String id) {
        this.id = id;
    }
    public void printInfo() {
        System.out.printf("\nName: %s\nid: %s\nisCET6passed: %b\npaperCount: %d\n", name,id,isCET6passed,paperCount);
    }
    public boolean isExcellent() {
        return isCET6passed&& paperCount >= 5;
    }
}
